var MaxQueue = function () {
  this.max = [-1]
  this.arr = []
};

/**
 * @return {number}
 */
MaxQueue.prototype.max_value = function () {
  if(!this.arr.length) return -1
  return this.max[this.max.length-1]
};

/** 
 * @param {number} value
 * @return {void}
 */
MaxQueue.prototype.push_back = function (value) {
  if(this.max.length==0){
    this.max.push(value)
  }else
  if (value > this.max[this.max.length-1]) {
    this.max.push(value)
  }
  this.arr.push(value)
};

/**
 * @return {number}
 */
MaxQueue.prototype.pop_front = function () {
  if(!this.arr.length) return -1
  else {
    const ele = arr.shift()
    if(ele==this.max[this.max.length-1]){
      this.max.pop()
    }
  }
};

/**
 * Your MaxQueue object will be instantiated and called as such:
 * var obj = new MaxQueue()
 * var param_1 = obj.max_value()
 * obj.push_back(value)
 * var param_3 = obj.pop_front()
 */